package com.example.demo.school.repositories;

import com.example.demo.school.models.StType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface StTypeRepository extends JpaRepository<StType, Long>, JpaSpecificationExecutor<StType> {


    List<StType> findByNameLike(String name);

    @Transactional
    @Modifying
    @Query("delete from StType s where s.id in :ids")
    void deleteByIds(@Param("ids") List<Long> ids);
}